package udpmessaging;

import com.messaging.UdpMq;
import java.net.InetAddress;

/**
 * @author sad
 */
public class TestUdpClientNR {

    public static void main(String[] args) throws Exception {
        System.out.println("Start Client");
        long start = System.currentTimeMillis();
        UdpMq mq = new UdpMq(5673);
        mq.start();
        InetAddress address = InetAddress.getLocalHost();
        mq.sendMessage(new byte[100], address, 9874);
        Thread.sleep(500);
        byte[] b = new byte[1500];
        for (int i = 0; i < 50000; i++) {
            UdpMq.copyIntToArray(b, i, 0);
            mq.sendMessage(b, address, 9874);
        }

        long end = System.currentTimeMillis();
        System.out.println("" + (end - start));
    }
}
